{extend name="public/base" /}
{block name="title"}
<h1>后台菜单列表</h1>
{/block}
{block name="content"}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-info">
                <div class="box-header">
                    <a class="btn btn-primary btn-sm margin" href="{:url('menu/adminmenuadd','id=')}">
                        +添加一级菜单
                    </a>
                </div>
                <div class="box-body table-responsive no-padding">
                    <table class="table table-hover table-bordered">
                        <thead>
                        <tr>
                            <th width="11%">ID</th>
                            <th width="12%">菜单名称</th>
                            <th width="12%">跳转路径</th>
                            <th width="11%">父级ID</th>
                            <th width="13%">图标</th>
                            <th width="11%">排序</th>
                            <th width="10%">状态</th>
                            <th width="20%">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {php}echo $menu_list;{/php}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
{/block}
{block name="script"}
<script>
var doDel = function (id) {
    if (id === undefined || id === '') {
        layer.msg('请选择要操作的数据！', {icon: 2});
        return;
    }
    layer.confirm('若有子菜单则会将子菜单一起删除，确定要删除吗？',
        {
            btn: ['确定', '取消']
        },
        function () {
            location.href = "{:url('menu/changeStatus')}" + "?id=" + id + '&status=-1';
        },
        function () {
        });
};
</script>
{/block}